//
//  RadiolistTableViewCell.m
//  SunXi
//
//  Created by dllo on 15/11/28.
//  Copyright © 2015年 大远. All rights reserved.
//

#import "RadiolistTableViewCell.h"

@implementation RadiolistTableViewCell{
    UIImageView *_myimageView;
    UILabel *_tittlelabel;
    UILabel *_countlabel;
    UIImageView *_stateimageView;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self create];
    }
    return self;
    
}
- (void)create{
    _myimageView = [[UIImageView alloc]init];
    [SCV addSubview:_myimageView];
    
    _tittlelabel = [[UILabel alloc]init];
    [SCV addSubview:_tittlelabel];
    
    _countlabel = [[UILabel alloc]init];
    [SCV addSubview:_countlabel];
    
    _stateimageView = [[UIImageView alloc]init];
    [SCV addSubview:_stateimageView];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    
    [_myimageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(SCV).offset(10);
        make.left.equalTo(SCV).offset(15);
        make.height.mas_equalTo(60);
        make.width.mas_equalTo(60);
    }];
    [_myimageView sd_setImageWithURL:[NSURL URLWithString:self.model.coverimg] placeholderImage:[UIImage imageNamed:@"zan"]];
    
    [_tittlelabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(SCV).offset(10);
        make.left.equalTo(_myimageView.mas_right).offset(5);
        make.height.mas_equalTo(20);
        make.right.equalTo(SCV);
    }];
    _tittlelabel.text = self.model.title;
    _tittlelabel.font = [UIFont systemFontOfSize:15];
    
    
    [_countlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_myimageView.mas_right).offset(5);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(200);
        make.bottom.equalTo(_myimageView);
    }];
    
    _countlabel.text = [NSString stringWithFormat:@"听:%@",self.model.count];
    _countlabel.textColor = [UIColor colorWithRed:0.378 green:0.382 blue:0.393 alpha:0.800];
    _countlabel.font =[UIFont systemFontOfSize:13];

    
#warning 欠动态图;
    
    
    UIView *xian = [[UIView alloc]initWithFrame:CGRectMake(5, CHEIGHT  - 1, CWIDTH - 10, 1)];
    [SCV addSubview:xian];
    xian.backgroundColor = [UIColor blackColor];
    
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
